package com.mind.adjust.mapper.provider;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.jdbc.SQL;

public class TicketTaskCountSqlBuilder {
    public String buildSelectCountByDate(@Param("startTime") String startTime, @Param("endTime") String endTime) {
        return new SQL(){{
            SELECT("SUM(`count`)");
            FROM("aj_ticket_task_count");
            WHERE();
            if (startTime != null) {
                WHERE("`day` >= #{startTime}");
            }
            if (endTime != null) {
                WHERE("`day` <= #{endTime}");
            }
        }}.toString();
    }
}
